﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;

namespace KD.Sms.UI_Query
{
    public partial class frmNet : Form
    {
        public frmNet()
        {
            InitializeComponent();
        }

        private void frmNet_Load(object sender, EventArgs e)
        {
            ns1.C_Title = "采样机顶部摄像头";
            ns1.C_IP = ConfigurationManager.AppSettings["VideoIp"].ToString();

            ns2.C_Title = "车牌识别摄像头";
            ns2.C_IP = ConfigurationManager.AppSettings["CaptureIp"].ToString();

            ns3.C_Title = "采样机PLC";
            ns3.C_IP = ConfigurationManager.AppSettings["Cyj_Ip"].ToString();

            ns4.C_Title = "封装机PLC";
            ns4.C_IP = ConfigurationManager.AppSettings["Fzj_Ip"].ToString();

            ns5.C_Title = "封装机读卡器";
            ns5.C_IP = ConfigurationManager.AppSettings["Stm32IP"].ToString();

            ns7.C_Title = "激光光幕";
            ns7.C_IP = ConfigurationManager.AppSettings["XGA_Ip"].ToString();

            ns8.C_Title = "激光测距仪";
            ns8.C_IP = ConfigurationManager.AppSettings["LDS_Ip"].ToString();

            ns9.C_Title = "物流系统服务器";
            ns9.C_IP = "10.60.6.2";

            ns10.C_Title = "三级编码系统服务器";
            ns10.C_IP = "10.60.4.100";
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void timer1_Tick(object sender, EventArgs e)
        {
            ns1.DoPing();
            ns2.DoPing();
            ns3.DoPing();
            ns4.DoPing();
            ns5.DoPing();
            ns7.DoPing();
            ns8.DoPing();
            ns9.DoPing();
            ns10.DoPing();
        }

        private void frmNet_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Escape) this.Close();
        }
    }
}
